﻿using RabbitMQ.Client;

namespace RabbitMQSample.WebApi.RabbitMQLibs
{
    public interface IRabbitMQConnectionFactory : IDisposable
    {
        /// <summary>
        /// 获取渠道
        /// </summary>
        Task<IModel> GetChannelAsync(CancellationToken cancellationToken = default);
        /// <summary>
        /// 获取连接
        /// </summary>
        Task<IConnection> GetConnectionAsync(CancellationToken cancellationToken = default);
        /// <summary>
        /// 获取渠道
        /// </summary>
        Task<IModel> GetShareChannelAsync(ChannelTypeEnum channelType, CancellationToken cancellationToken = default);
    }
}
